{% extends 'BXTRLayoutBundle:Form:fields-bootstrap.html.twig' %}
{# extends 'form_div_layout.html.twig' #}
{% block datatables_selector_label %}
{% endblock datatables_selector_label %}

{% block datatables_selector_widget %}
{% spaceless %}
    {# hidden block containing the selected row-id #}
    {{ block('hidden_widget') }}
    <div class="col-xs-12">
    <table data-selection-field-id="{{ id }}" class="bxtr-autoload-datatables table table-hover table-striped table-bordered">
        <thead>
            {# display column headers. #}
            {% for label in table_labels %}
                <td>
                    {{ label|trans }}
                </td>
            {% endfor %}
        </thead>
        <tbody>
            {# display rows, store the id in the data-row-id attribute on the table-row (tr) block. #}
            {% for ent in table_values %}
                <tr data-row-id="{{ ent.identifier }}">
                    {% for value in ent.values %}
                        <td>{{ value }}</td>
                    {% endfor %}
                </tr>
            {% endfor %}
        </tbody>
    </table>
    </div>
{% endspaceless %}
{% endblock %}
{% block check_list_label %}
{#{% set label_attr = label_attr|merge({class: 'center-block'}) %}#}
    {{ block('form_label') }}
{% endblock %}
{% block datatables_check_list_widget %}
{# Expanded choice only #}
{% spaceless %}
    <div {{ block('widget_container_attributes') }}>
    <table class="bxtr-autoload-checklist table table-condensed table-striped table-bordered">
        <thead>
            <td>Séléction</td>
            <td>Valeur</td>
        </thead>
        <tbody>
        {% for child in form %}
            <tr>
                <td data-sort="{{ child.vars.value }}">{{ form_widget(child) }}</td>
                <td>{{ form_label(child, null, {label_attr:{class: "d"}}) }}</td>
            </tr>
        {% endfor %}
        </tbody>
    </table>
    </div>
{% endspaceless %}
{% endblock %}
